package 正则表达式;

public class Reg9 {
    public static void main(String[] args) {
        String name="李a";
        String p="[\u4e00-\u9fa5]{2,}|[a-zA-Z]{2,20}";
        System.out.println(name.matches(p));

        int age =17;
        //age>=18||age<=36
        String a="1";
        if(a.matches("\\d+")){
            int t =Integer.parseInt(a);
            if(t>=18&&t<=36){
                System.out.println("欢迎你");
            }else {
                System.out.println("年龄不符合");
            }

        }else {
            System.out.println("填写错误");
        }
    }
}
